local variable 'pge' referenced before assignment