implemented the failing test in the submission but works for me...
throw in next() if no more elements