Correct bug on filtering query.