added better error messages. (no html rendering yet)