fix min problem