improvements in the handle error with format