Get maxlevel dynamically