det_starting and det_startTime were not initialized before reading them in the poll function, leading to erratic behaviour.