fixed bug on non root directory