fixed the error handling bit in 'buildContactForm'