improved reliability of the script