properly acquire locks