use headfirst to check timeout