fixed layer deletion bug