Fixing: NameError: global name 'driver' is not defined