I'm not sure about this script being a top level script.  This feels like something that would be better served as a question in the support forum.