Fixed timeout flag bug