Fixed authorize bug