fixed flaw in ID handling