properly update *_id fields