added default exception handler to print errors