check length of query and test for variants