Added exception and output messages