small bug fix but generateFilter still seems buggy