change error handling, add more tests