updated to to use the DB