fixed potential double hoisting edge case