changed to use single html page and to handle html from js