Add before filter functionality