updated access_token function