Fixing batch locking issue