add tests for errors