messages functionality updated