add trailing space check