added preInit with changes
added preInit with changes