making filter more thread safe in case it's reused across requests