Bill updated registration function and added validation to it.