fixing database class