Fixed disappearing components when switching template