fix a lock problem