doing message function