create new thread to insert/update into database