changing controllers and pages to deal with empty table and null values