added a nicer error for missing templates