Fixed error in filtering