Fixed VERY stupid mistake and delocalized variable