Support 4.0+
Fix auto login crash