Fix behaviour with multiple processes