working on lock handler