made changes to allow before in routing