added preloader function that doesn't work