Fix loading issues when using synthetic dom ready events