set min and max values