correct management of null id.