Use Dir.chdir instead of thor-method to fix bug