fix: race conditions