fix early return bug: global assign interpreted as early return