Fixed database error