Fixed bug in filterForFrequency