Add handle for exceptions