fix for UnboundLocalError: local variable 'temp_filename' referenced before assignment in smr-map