Fixed global name 'e' is not defined