When you first load a page, mediaCheck goes into every media query, even if it’s not relevant, which then triggers an exit event. (e.g. media: '(min-width: 64.063em)' is entered even if the browser width is less than 64.063em). I had to get around it by setting a flag and using it in all of the exit functions (if (vInitialCheck) return;) except for the last one, where I reset the flag (if (vInitialCheck) {vInitialCheck = false; return;} Is there a way to add this to the main code? I don't think functions should ever get run unless you actually are in a valid media query for the browser size.