Introduce 2 levels of locking