added messages functionality