Fix error in isAuthorized()