fixed issue with template inclusion order