Modified try catch when use MongoDB