fixes #17 curl error handling improved