made the scripts more reliable