bug fix : when z_data[x] is 0, z_value is undefined