trying to get rid of race condition causing js errors site-wide