removed bug in filtering