putting in rudimentary error messages