function and db methods added for private messaging