fix toggle lock functionality