fix probrem on boxHeight == maxHeight