Adding a throw exception when filter is not defined