fix bug longest common substring