fixed a bug undefined b