added addGlonalMessage() function.