fix level logic error