updated to craete script tag internally