bash PWD variable not set correctly