fixed bug in level
min