update checkCoverage to work with MongoDB