fix bug brought by try statement