Fixed the stackoverflow caused by saving object loop.