You probably have the variable trying to do more that what an 8 bit variable can do. I don't really know how to fix it.