updated with database class