implemented toggle lock