fix bug storing timestamps