fixed error in javascript runnig within the html