fix timestamp handling