add latch,queue and file i/o