replaced finish() with next()