fixed off by one arrow with string allocation using valgrind