fixed bug that caused streaming to files to break

check for mongodb flag before doing any database initialization