removes null references to scripts