private messaging function with error alert