fix RedLogic code