Fixing issue with multiple instances on a page