fix crash when removing layers with highlighed features