added unit tests for errors