Added try catch for mongoose