fixing undefined ids