Fix timeout check bug