fix for old queries