Adding error handling to deletion code.