trying to fix levelmax problem