changeDir function now raises an error if it can't change to a user's home dir