complete ch6 but error handling not working