implement message (un)read  function