Added dynamic script insertion