Filtering $total_where variable