update cd function to change PWD