Fix lock in initilization