FIX "NameError: global name 'retrieve' is not defined"