Quick fix to destroy element on error event