fix min method