Made the script properly run on page-load.