fixing bug where accsessing id not object