calling function from index.html