Add try exception to handle non-int error.