Fix error using fname string as object name instead of string