Fix a bug which required user to login again after token expiration