Fixed error trapping when submitting fields