updated for db schema changes