added a todo: better error messages