add script loading and dom functionality