added getMessage function