fix bug in mongodb create code