added form error check prototype