fix level comparison