fix 1st bug: getting wrong var position