trying to fix JS #2

Moved position of variable