added login and autologin