fixed a bug where the last character of each sequence was ignored