Changed redirects and fixed flow