should this be in the if block given you would not need this if it is not a root path?