Fix bug with multiple processes