Added try-catch in get statistics method