updated database class