cleaning the script for proper new version