fixed javascript and html problems