fixed some silly state stuff and added preloader