resolved deadlock with flagmen