Redo _fetch_access_code as I had no idea what it was supposed to do