fix debug output (opening file)