UnboundLocalError: local variable 'curResults' referenced before assignment *fixed*