fixed the setcurrentdirectory method