added hack for manually performing code exchange