fix the change of current directory bug