fixing mongo errors