better control of layer deletion