added threaded writing as to not stall the game on death