fix out of range

if you start at i-1 then your first iteration will start the substring at -1, this kills the substring