Move error handling to filter