add null check to receiveAccessToken