Fixed type reference
fixed undefined property on Query
instanceof is better for IDE autocompletion