fixes to make sure two or more instances on a page work independently