fixed function login and register

fixed function login and register