don't flatten if flatten param false supplied