Fixed user login and register on client side