corrected time_stamp calc