try catch implementation