removed getMainContext from the filter method