fix level loop