Switch to load event to make sure jQuery is loaded