fixed bug with dir change