fix {safe: true} issue in mongodb