add error handling for z85