add fileName NULL check on temp_fstream