removed ARC and modified code to wait syncronically for permissions