setting directory correctly