improve authentication filter