fix data races in controller

Fix #305
Clarify this comment.