fix: to maintain head and tail pointers of the string.