Updated code to get message of the selected user