fixed a bug in the internal dimfilter function