diff --git a/01b_MesobromionCluster.R b/01b_MesobromionCluster.R
index 75528f350a98e87665fa3bf1622b2289d49ed933..ae5032bbc1e15f65a610f05ff3c38e4309c5badc 100644
--- a/01b_MesobromionCluster.R
+++ b/01b_MesobromionCluster.R
@@ -83,8 +83,11 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
   
   if(exclude.na==T){
     print("Excluding NAs and recalculating relative covers")
-    traits <- traits %>% 
-      filter(complete.cases(.))
+    traits <- traits %>%
+      rownames_to_column("species0") %>%	 
+      filter(complete.cases(.)) %>% 
+      column_to_rownames("species0")
+
     species <- species %>% 
       dplyr::select(rownames(traits)) %>% 
       mutate(sumVar = rowSums(.)) %>%