add try catch for some function