Fixed ListView functionality (new database function)