read function fix for messaging