Redid logic of authorization