Fix filepath never reaches root path

Refer to #11