diff --git a/submit_bcbio_trio_wes.sh b/submit_bcbio_trio_wes.sh
index 9fd1274f5dc57881732c7c6b9068ccb4df271b77..a03a424f8747756022836fb097b3f0856c1b3826 100755
--- a/submit_bcbio_trio_wes.sh
+++ b/submit_bcbio_trio_wes.sh
@@ -41,10 +41,12 @@ then
 
   # fix VCF output file names
   cd $OUTPUT_DIR/${DATE}_${PROJECT_ID}_${FAMILY_ID}
-  if [ -e ${PROJECT_ID}${FAMILY_ID}-gatk-haplotype-annotated.vcf.gz ]
+  if [ ! -e ${FAMILY_ID}-gatk-haplotype-annotated.vcf.gz ]
   then
-    mv ${PROJECT_ID}${FAMILY_ID}-gatk-haplotype-annotated.vcf.gz ${PROJECT_ID}_${FAMILY_ID}-gatk-haplotype-annotated.vcf.gz
-    mv ${PROJECT_ID}${FAMILY_ID}-gatk-haplotype-annotated.vcf.gz.tbi ${PROJECT_ID}_${FAMILY_ID}-gatk-haplotype-annotated.vcf.gz.tbi
+    PREFIX=`echo $FAMILY_ID | cut -d '_' -f 1`
+    SUFFIX=`echo $FAMILY_ID | cut -d '_' -f 2`
+    mv ${PREFIX}${SUFFIX}-gatk-haplotype-annotated.vcf.gz ${FAMILY_ID}-gatk-haplotype-annotated.vcf.gz
+    mv ${PREFIX}${SUFFIX}-gatk-haplotype-annotated.vcf.gz.tbi ${FAMILY_ID}-gatk-haplotype-annotated.vcf.gz.tbi
   fi
 
 else