Added support for Apply method on Query object