fixed a join issue in MvcDatabase