Fixs authorization edge case for AD