fix NameError: global name 'content' is not defined