Fixed the bug about the starting dir for running scripts