fixes problem showing hidden layers without legends