Move reacGoal in window.onload function