Change to using a boolean flag, rather than a time-before