free method for generator