Improve autologin script