removed some bloat, added regex to catch returned nextUrl and assign it