fixed a bug in initilization.