added code to add ItemData instances only when the row passes the where condition.