add error handling when not using Twig