counter with try exception style