making locking for all layers