attempt to fix race conditions with multiple writers