adding global locks to make neighborlists work