fix try-catch bug