fixed bug with timedelta