Added dedicated thread for saving stuff to the DB