changing message:sync to stop when it gets null instead of an array (empty or otherwise)