fixing bug with wrong ids