try to figure out lock working