fixed a wrap around bug in the address counter