As opposed to setting this in initialize and on each call of handle_data, maybe it should be set once in the run method (and unset when the method exits)?