got the before filter working properly