changed the authorize method