added conditional root dir