fixed sql error in EditMachine code