converted to one page app and added onchange