change some logic for check stuck, add checkmap, implemented relogin function