made some changes to change dir