added error handling to pwd change