fixed unproper determining of the timespan