fix infinite loop in case of no time given for a class