fix bug now that we have to use vanilla JS