added filter type checking