fix a bug regarding to wg