diff --git a/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BaseCounter.scala b/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BaseCounter.scala
index e9817cc90e2131820fd134383de2f1856cccfd18..7745f85dd902ce0c56bac9f0140c0c54fd02b2f7 100644
--- a/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BaseCounter.scala
+++ b/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BaseCounter.scala
@@ -63,6 +63,7 @@ object BaseCounter extends ToolCommand {
     logger.info("Start reading RefFlat file")
 
     val bamReader = SamReaderFactory.makeDefault().open(cmdArgs.bamFile)
+    require(bamReader.hasIndex, "Bamfile require an index")
     val geneReader = GeneAnnotationReader.loadRefFlat(cmdArgs.refFlat, bamReader.getFileHeader.getSequenceDictionary)
     bamReader.close()
     logger.info("Done reading RefFlat file")