added locks around the locks