added catch for exception and deprecation notice