added before() method to router plugin