trimap: fix deadlock, set the flag back to false