Structure defects and electronic properties of MXenes