Fix bugs for cd

searchfiledir is buggy