updaing id logic