fix script nesting