improve directory handling through $PWD