made the script safer
merge