fix serialization and db match issues