fix data races in controller

Fix #305
Why are you remaking the condition?