added name parameter for getMessages and getJoinedMessage