corrected time functionality