Add check to not use filter if no values provided

The filter should not be used if the query parameter is
not used. This was causing problems with deleting.