changed extractId method