added locks everythere