Added check filter input exists before calling function on it