Fix recursive bug