Handle pwd better