fix the database lock when adding an item due to multiple threads, which is the output from the server for each category