Fixed example with hoisting