fix authorize method