handle out of bounds counter even with sigsegv