fixed problem with empty templates after applying a valid one