modify the initialization of variable change_dir;
change_dir is initialized as NULL