added query timeout support