diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js
index 1d8a7b9ca8..193f568d51 100644
--- a/js/server_status_monitor.js
+++ b/js/server_status_monitor.js
@@ -1187,8 +1187,10 @@ $(function() {
// time span selection
$('#gridchart' + runtime.chartAI).bind('jqplotMouseDown', function(ev, gridpos, datapos, neighbor, plot) {
selectionTimeDiff.push(datapos.xaxis);
- $('#selection_box').remove();
- selectionBox = $('
');
+ if($('#selection_box').length) {
+ $('#selection_box').remove();
+ }
+ selectionBox = $('
');
$(document.body).append(selectionBox);
selectionStartX = ev.pageX;
selectionStartY = ev.pageY;
@@ -1203,7 +1205,6 @@ $(function() {
$('#gridchart' + runtime.chartAI).bind('jqplotMouseUp', function(ev, gridpos, datapos, neighbor, plot) {
selectionTimeDiff.push(datapos.xaxis);
- $('#selection_box').attr({ id: '' });
//get date from timestamp
var min = new Date(Math.ceil(selectionTimeDiff[0]));
var max = new Date(Math.ceil(selectionTimeDiff[1]));