smarter destroy_layer