wrapping filtering in try/catch block