trying to fix some problems with scripts