client code with login register