updated beforefilter