added code to flush delete queue after long polling