Fix filepath never reaches root path