fix error when wrong values submitted to fields