fixed a lock issue