Implemented preloader functionality