Add exception handling to counting script.