Ensure that the script is removed from "@scripts" when exiting or killed