changed conditional to evauluate root path