add error directive