fix filtered query