Fix how unique filter is applied