Fixed bug with double declaration of the same variable