first working version of autologin