Fixes resource loading on page load.

Fixes an issue where resources wouldn't load on an initial page load.