fixed a bug about min