add method for register and login users