Added additional check that filter input is defined