fix error with undefined id