fix $pwd checking