better error handler
Add test for errors
Add travis tests