fix match trailing space error