make sure cost fields exist before accessing them