Logic bugs on when to serialize the data to the db