add auto login and retry feature