Added generic exception handler