added error handling to trial reg form