corrected database class