add error handling to executor; todo: integrate with functions