fixed error handle