added handlebars templating for prompt, non crashing error handling