Fixed race condition in listenFor