Added support for logging in/out