fixed a bug to generate initial configurations.