improve preloader functionality