updated script with dispatcher script instead of pollForChanges