crash on cached query bugfix