Fixing possible concurrency issue on sliding time windows