message read function