added unit test for preloader, fixed preloader bug
added unit test for preloader, fixed preloader