fixed issue with serialization of empty messages