added waiting thread exit flag, to be cleaned up later