fixed logic in lock stale check