fix releasing locks with >2 nodes