onclick listener for the messages in the list