fixing few bug when changing path