fixxing bug in min value expression