as some variables were incorrectly unset, it could lead to script issues when the script was used more than one time