moved preloading to event