Fixed a bug in scope of my variable