Added checking for null docs due to poor web connection