Fixed auto generation of id