fix a bug in pwd processing