potentially fix rare deadlock assuming handle loop takes mutex too fast again so changeMode never takes it