Fix infinite loop in startup