When Hanuman continued to misbehave, powerful sages cursed him to forget his magic powers, such as the ability to fly or to become infinitely large, until he was reminded of them.