Removing "global" declaration from if block

In python an "if" block doesn't change the scope. So, global not needed as it was creating an warning.