fix bug: try catch block