bug fix for seting max level