adding type only if clean.layers are not undefined