make the constructor like othe output constructors
kill the generator thread on close