fixed one more min/max bug