added more autologin code and iframe reloading code