use Duration instead of double
fix serialization