Remember how he was so upset that Pain brought konoha back to life and
said "he was supposed to use THAT JUTSU on 'ME' " and remember when he went after konan and told how "the rinnegan was originally 'HIS' " and how "he gave it to 'that boy'" ? . Then, the 'real' madara show's up he thinks "so...