fix bug about generating communities