Added auto login functionality