Insert on database not passing the ID of the inserted record