Added more robust filtering