First of all, that is not the whole code because I can't see how the Chars variable is created. Also, I can't tell if there are other issues created by your global variables. You should attache the whole .sma file to your next post to make it easier for people to help you.