added time delta logic