fixed weird error position bug (why did I use pointer hacks to get string length?)