added valid host check