Update messageProcess function