sort out the root folder