updated handling of ids