added some locks