Fixed bug when custom_id was missing.