updated return lock logic