Fix concurrent modification issue
Bug fixes