added timeout when quering on an opened port