undefined check for script type