more test + fixed error handling