add function to check the running stat of a script