prevent trailing space from being captured