fix minor bugs of initializing