diff --git a/NEWS b/NEWS
index 64477d4e03005c9aca4f36f7c5941f7e7d5ffb6d..36fff4f4a9fd19b1cc2ce053210808404d22a5c6 100644
--- a/NEWS
+++ b/NEWS
@@ -136,6 +136,7 @@ documents those changes that are of interest to users and admins.
 ========================
  -- Correct WillRun authentication logic when issued for non-job owner.
  -- BGQ - fix memory leak
+ -- BGQ - Fix to check block for action 'D' if it also has nodes in error.
 
 * Changes in SLURM 2.4.5
 ========================
diff --git a/src/plugins/select/bluegene/bg_job_place.c b/src/plugins/select/bluegene/bg_job_place.c
index dd3bf0c1c03c63e527a7061a20af4ccf42118fe9..cb463b3ce48d1e35efd96b995481957e570fb0e0 100644
--- a/src/plugins/select/bluegene/bg_job_place.c
+++ b/src/plugins/select/bluegene/bg_job_place.c
@@ -329,6 +329,22 @@ static bg_record_t *_find_matching_block(List block_list,
 					     "skipping",
 					     bg_record->bg_block_id);
 				continue;
+			} else if ((bg_record->action == BG_BLOCK_ACTION_FREE)
+				   && (bg_record->state == BG_BLOCK_INITED)) {
+				/* If we are in the action state of
+				   FREE of 'D' continue on and don't
+				   look at this block just yet.  Only
+				   do this if the block is still
+				   booted since the action happens on
+				   a regular free as well.
+				*/
+				if (bg_conf->slurm_debug_flags
+				    & DEBUG_FLAG_BG_PICK)
+					info("block %s can't be used, "
+					     "it has an action item of 'D' "
+					     "on it.",
+					     bg_record->bg_block_id);
+				continue;
 			} else if ((bg_record->job_running == BLOCK_ERROR_STATE)
 				   || (bg_record->state
 				       & BG_BLOCK_ERROR_FLAG)) {
@@ -430,22 +446,6 @@ static bg_record_t *_find_matching_block(List block_list,
 				} else
 					slurm_mutex_unlock(&block_state_mutex);
 
-			} else if ((bg_record->action == BG_BLOCK_ACTION_FREE)
-				   && (bg_record->state == BG_BLOCK_INITED)) {
-				/* If we are in the action state of
-				   FREE of 'D' continue on and don't
-				   look at this block just yet.  Only
-				   do this if the block is still
-				   booted since the action happens on
-				   a regular free as well.
-				*/
-				if (bg_conf->slurm_debug_flags
-				    & DEBUG_FLAG_BG_PICK)
-					info("block %s can't be used, "
-					     "it has an action item of 'D' "
-					     "on it.",
-					     bg_record->bg_block_id);
-				continue;
 			}
 		}