Fixing database class