modified mongo connect to use new api