turn a generator function back into a normal one