fix var references, cascade param and logic