fix issue in case id is nil