fix filter error handling and error counting