error handling when filtering