fixed some bugs of jumping to the right directory