fixed timestamp calc error