Amend flex script