db fix and model/controller adjustments