handling timeout generator closing