Moved javascript code to the footer