fix time writing