added min check for values