Fixed concurrency issue, re-added caughtUp flag.