some code improovement in sub handle_i2c_reply