FAIMS-884: fixed bug with running legacy selection query