pass in a DB when we create a DBRef.  should fix #507