diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
index f8d3831..0de3161 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
@@ -179,7 +179,7 @@
         try
         {
             StringWriter w = new StringWriter();
-            writeJSON( w, null, null, null, true, Locale.ENGLISH, null );
+            writeJSON( w, null, null, null, true, Locale.ENGLISH, null, null );
             String jsonString = w.toString();
             JSONObject json = new JSONObject( jsonString );
 
@@ -261,7 +261,7 @@
             final String servicesRoot = getServicesRoot( request );
             try
             {
-                this.renderJSON(response, reqInfo.bundle, pluginRoot, servicesRoot, request.getLocale(), request.getParameter(FILTER_PARAM) );
+                this.renderJSON(response, reqInfo.bundle, pluginRoot, servicesRoot, request.getLocale(), request.getParameter(FILTER_PARAM), null );
             }
             catch (InvalidSyntaxException e)
             {
@@ -281,6 +281,7 @@
     protected void doPost( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException
     {
         boolean success = false;
+        BundleException bundleException = null;
         final String action = WebConsoleUtil.getParameter( req, "action" );
         if ( "refreshPackages".equals( action ) )
         {
@@ -327,6 +328,7 @@
                     }
                     catch ( BundleException be )
                     {
+                        bundleException = be;
                         log( "Cannot start", be );
                     }
                 }
@@ -340,6 +342,7 @@
                     }
                     catch ( BundleException be )
                     {
+                        bundleException = be;
                         log( "Cannot stop", be );
                     }
                 }
@@ -365,9 +368,23 @@
                     }
                     catch ( BundleException be )
                     {
+                        bundleException = be;
                         log( "Cannot uninstall", be );
                     }
                 }
+
+                // let's wait a little bit to give the framework time
+                // to process our request
+                try {
+                    Thread.sleep(800);
+                } catch (InterruptedException e) {
+                    // we ignore this
+                }
+
+                // write the state only
+                resp.getWriter().print("{fragment:" + isFragmentBundle(bundle) //
+                    + ",stateRaw:" + bundle.getState() + "}");
+                return;
             }
         }
 
@@ -384,7 +401,7 @@
             final String servicesRoot = getServicesRoot( req );
             try
             {
-                this.renderJSON( resp, null, pluginRoot, servicesRoot, req.getLocale(), req.getParameter(FILTER_PARAM) );
+                this.renderJSON( resp, null, pluginRoot, servicesRoot, req.getLocale(), req.getParameter(FILTER_PARAM), bundleException );
             }
             catch (InvalidSyntaxException e)
             {
@@ -483,7 +500,7 @@
         StringWriter w = new StringWriter();
         try
         {
-            writeJSON(w, reqInfo.bundle, pluginRoot, servicesRoot, request.getLocale(), request.getParameter(FILTER_PARAM) );
+            writeJSON(w, reqInfo.bundle, pluginRoot, servicesRoot, request.getLocale(), request.getParameter(FILTER_PARAM), null );
         }
         catch (InvalidSyntaxException e)
         {
@@ -495,26 +512,26 @@
         response.getWriter().print(TEMPLATE_MAIN);
     }
 
-    private void renderJSON( final HttpServletResponse response, final Bundle bundle, final String pluginRoot, final String servicesRoot, final Locale locale, final String filter )
+    private void renderJSON( final HttpServletResponse response, final Bundle bundle, final String pluginRoot, final String servicesRoot, final Locale locale, final String filter, final BundleException be )
         throws IOException, InvalidSyntaxException
     {
         response.setContentType( "application/json" );
         response.setCharacterEncoding( "UTF-8" );
 
         final PrintWriter pw = response.getWriter();
-        writeJSON(pw, bundle, pluginRoot, servicesRoot, locale, filter);
+        writeJSON(pw, bundle, pluginRoot, servicesRoot, locale, filter, be);
     }
 
 
-    private void writeJSON( final Writer pw, final Bundle bundle, final String pluginRoot, final String servicesRoot, final Locale locale, final String filter )
+    private void writeJSON( final Writer pw, final Bundle bundle, final String pluginRoot, final String servicesRoot, final Locale locale, final String filter, final BundleException be )
         throws IOException, InvalidSyntaxException
     {
-        writeJSON( pw, bundle, pluginRoot, servicesRoot, false, locale, filter );
+        writeJSON( pw, bundle, pluginRoot, servicesRoot, false, locale, filter, be );
     }
 
 
     private void writeJSON( final Writer pw, final Bundle bundle, final String pluginRoot,
-        final String servicesRoot, final boolean fullDetails, final Locale locale, final String filter ) throws IOException, InvalidSyntaxException
+        final String servicesRoot, final boolean fullDetails, final Locale locale, final String filter, final BundleException be ) throws IOException, InvalidSyntaxException
     {
         final Bundle[] allBundles = this.getBundles();
         final Object[] status = getStatusLine(allBundles);
@@ -553,9 +570,18 @@
         {
             jw.object();
 
+            if (null != be)
+            {
+                final StringWriter s = new StringWriter();
+                final Throwable t = be.getNestedException() != null ? be.getNestedException() : be;
+                t.printStackTrace( new PrintWriter(s) );
+                jw.key( "error" );
+                jw.value( s.toString() );
+            }
+
             jw.key( "status" );
             jw.value( statusLine );
-
+            
             // add raw status
             jw.key( "s" );
             jw.array();
@@ -1059,7 +1085,7 @@
     {
         JSONArray val = new JSONArray();
 
-        Dictionary headers = bundle.getHeaders();
+        Dictionary headers = bundle.getHeaders(""); // don't localize at all - raw headers
         Enumeration he = headers.keys();
         while ( he.hasMoreElements() )
         {
diff --git a/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties b/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
index 10cd41a..d43d617 100644
--- a/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
+++ b/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
@@ -158,6 +158,8 @@
 bundles.state.32=Активен
 bundles.state.unknown=Непознат статус: {0}
 bundles.state.fragment=Фрагмент
+# action error
+bundles.error.title=Грешка при изпълнение на операцията!
 
 
 # Components plugin
diff --git a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
index fea335f..d91f369 100644
--- a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
+++ b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
@@ -157,6 +157,8 @@
 bundles.state.32=Active
 bundles.state.unknown=Unknown State: {0}
 bundles.state.fragment=Fragment
+# action error
+bundles.error.title=Error while executing bundle operation!
 
 
 # Components plugin
diff --git a/webconsole/src/main/resources/res/ui/bundles.js b/webconsole/src/main/resources/res/ui/bundles.js
index b263597..a36c5c1 100644
--- a/webconsole/src/main/resources/res/ui/bundles.js
+++ b/webconsole/src/main/resources/res/ui/bundles.js
@@ -19,6 +19,7 @@
 var bundlesTable    = false;
 var bundlesBody     = false;
 var bundlesTemplate = false;
+var bundleOpError   = false;
 
 function renderData( eventData, filter )  {
 	lastBundleData = eventData;
@@ -39,6 +40,9 @@
         showDetails(id);
     }
     initStaticWidgets();
+	
+	// show dialog on error
+	if (eventData.error) bundleOpError.dialog('open').find('pre').text(eventData.error)
 }
 
 function entry( /* Object */ bundle, filter ) {
@@ -69,34 +73,46 @@
 	tr.find('td:eq(1) span:eq(1)').html( drawDetails ? name : '<a href="' + pluginRoot + '/' + id + '">' + name + '</a>' );
 	tr.find('td:eq(2)').text( bundle.version );
 	tr.find('td:eq(3)').text( bundle.category );
-	tr.find('td:eq(4)').text( stateString(bundle) );
 	if (id == 0) { // system bundle has no actions
+		tr.find('td:eq(4)').text( stateString(bundle) );
 		tr.find('td:eq(5) ul').addClass('ui-helper-hidden');
 	} else {
-		var start   = tr.find('td:eq(5) ul li:eq(0)');
-		var stop    = tr.find('td:eq(5) ul li:eq(1)');
-		var refresh = tr.find('td:eq(5) ul li:eq(2)').click(function() {changeDataEntryState(id, 'refresh')});
-		var update  = tr.find('td:eq(5) ul li:eq(3)').click(function() {changeDataEntryState(id, 'update')});
-		var remove  = tr.find('td:eq(5) ul li:eq(4)');
-		start = hasStart(bundle) ?
-			start.click(function() {changeDataEntryState(id, 'start')}) :
-			start.addClass('ui-helper-hidden');
-		stop = hasStop(bundle) ?
-			stop.click(function() {changeDataEntryState(id, 'stop')}) :
-			stop.addClass('ui-helper-hidden');
-		remove = hasUninstall(bundle) ?
-			remove.click(function() {changeDataEntryState(id, 'uninstall')}) :
-			remove.addClass('ui-helper-hidden');
+		entrySetupState( bundle, tr, id );
 	}
 	return tr;
 }
+function entrySetupState( /* Object */ bundle, tr, id) {
+	var start   = tr.find('td:eq(5) ul li:eq(0)').removeClass('ui-helper-hidden').unbind('click');
+	var stop    = tr.find('td:eq(5) ul li:eq(1)').removeClass('ui-helper-hidden').unbind('click');
+	var refresh = tr.find('td:eq(5) ul li:eq(2)').unbind('click').click(function() {return changeDataEntryState(id, 'refresh')});
+	var update  = tr.find('td:eq(5) ul li:eq(3)').unbind('click').click(function() {return changeDataEntryState(id, 'update')});
+	var remove  = tr.find('td:eq(5) ul li:eq(4)').removeClass('ui-helper-hidden').unbind('click');
+	start = hasStart(bundle) ?
+		start.click(function() {return changeDataEntryState(id, 'start')}) :
+		start.addClass('ui-helper-hidden');
+	stop = hasStop(bundle) ?
+		stop.click(function() {return changeDataEntryState(id, 'stop')}) :
+		stop.addClass('ui-helper-hidden');
+	remove = hasUninstall(bundle) ?
+		remove.click(function() {return changeDataEntryState(id, 'uninstall')}) :
+		remove.addClass('ui-helper-hidden');
+	tr.find('td:eq(4)').text( stateString(bundle) );
+}
 
 function loadData() {
     $.get(pluginRoot + "/.json", null, renderData, "json"); 
 }
 
 function changeDataEntryState(/* long */ id, /* String */ action) {
-    $.post(pluginRoot + "/" + id, {"action":action}, renderData, "json"); 
+    $.post(pluginRoot + '/' + id, {'action':action}, function(b) {
+		var _tr = bundlesBody.find('#entry' + id);
+		if (1 == b.stateRaw)  { // uninstalled
+			_tr.remove(); 
+		} else {
+			entrySetupState( b, _tr, id );
+		}
+	}, 'json');
+	return false;
 }
 
 function refreshPackages() {
@@ -184,6 +200,13 @@
 		return false;
 	});
 
+	bundleOpError = $('#bundleOpError').dialog({
+		autoOpen: false,
+		modal   : true,
+		width   : '80%'
+	});
+	bundleOpError.parent().addClass('ui-state-error');
+
 	// filter
 	$('.filterApply').click(function() {
 		if ($(this).hasClass('ui-state-disabled')) return;
diff --git a/webconsole/src/main/resources/templates/bundles.html b/webconsole/src/main/resources/templates/bundles.html
index 8f956db..3ec8bb0 100644
--- a/webconsole/src/main/resources/templates/bundles.html
+++ b/webconsole/src/main/resources/templates/bundles.html
@@ -140,3 +140,5 @@
 	</table>
 	</form>
 </div>
+
+<div id="bundleOpError" class="ui-helper-hidden" title="${bundles.error.title}"><pre>&nbsp;</pre></div>
