Fixed broken sellStock and buyStock. The problem was isValid on query returns true if query is set on valid record, but to do this one first need to call .next() on query object.