before routing