fix mongodb errors