better timestamp handling