Fixed error with javascript in html and added cleanup of iframe