Added ability to log in and out.