Fixed next_url which was not correctly passed