diff --git a/trunk/mapreduce/src/java/com/marklogic/mapreduce/utilities/InternalUtilities.java b/trunk/mapreduce/src/java/com/marklogic/mapreduce/utilities/InternalUtilities.java
index <HASH>..<HASH> 100644
--- a/trunk/mapreduce/src/java/com/marklogic/mapreduce/utilities/InternalUtilities.java
+++ b/trunk/mapreduce/src/java/com/marklogic/mapreduce/utilities/InternalUtilities.java
@@ -297,9 +297,13 @@ public class InternalUtilities implements MarkLogicConstants {
      * Return the host from the host array based on a random fashion
      * @param hosts a WritableArray of host names
      * @return the host name
+     * @throws IOException 
      */
-    public static String getHost(TextArrayWritable hosts) {
+    public static String getHost(TextArrayWritable hosts) throws IOException {
         String [] hostStrings = hosts.toStrings();
+        if(hostStrings == null || hostStrings.length==0) 
+            throw new IOException("Number of forests is 0: "
+                + "check forests in database");
         int count = hostStrings.length;
         int position = (int)(Math.random() * count);
         return hostStrings[position];
bug:<I>
better error msg when mlcp copy to a db without a forest