keep min and max value to fix bugs@