fixed error with totime / fromtime being NaN / undefined