use queue pl to fix race conditions