fixed key serialization

If primary key is DateTime object than you will get error message for object to string serialization