fixed recursive bug.