fixed earlier mistakes in the mvc pattern.