to complete the getkeymessages