fixed the authorize method