added html template

fixed range check