fix time duration bug in time_helper