Fixed redirect bug in oauth