remove duplicated lock checking