add register function in index.html