fix to use apropriate lock