add validation function on register page