fixed bugs with mongo