Fix filepath never reaches root path

Refer to #11 
I was talking about this line. See my comments.