Fixed a lock bug.