Fixed sorting by setting rootpath for model to be the new root path chosen