fixed filter if statement