lastIndex. fix #1