Fix timeout check