handling token expiration gracefully