Fix a minor bug in script action