Probably because of
Code:
insertAt(str, ind);