repaired some issues with scripts