bug fix, get max level
sql needed <=, not =

also added reference to moDB in ElementData constructor