fixed bugs on the lock for a chunk.