Removed redundant code for script activities