fixed filter if/else statement