fixed filter and distinct, getting a few unknown runtime errors