fixed conflict between two variables called d