FIXED: a bug in updating key

Fixed the id row to match to the trusted_contact row's reference number rather then the message rows id number.