adding error checking to registration form