fix filter query bug introduced in last commit