Revert "Revert "Fix duplicated variable""

This reverts commit 174bb029ad2de83c0d24c5ef2a417744ca636fc8.