fix max level bugs