exit with error code 1 when the counter value is invalid