add simple before filter functionality