fixing bug in machines controller