added preinit script to main file