Fixed hoisting issue