add a test that inserts a conflicting entry to the test database, adjust sorting to stabelize