switch to rauth and fixed bugs