Extract the id correctly