Adding functions to message js