fix min case