added oauth logic