add validation of login and register