added test to onpreload
cosmetic changes