Fixed bug with empty figure tags. Added JS file to the element.