Help please

Ok so i am a mom who loves her coffee and i would drink it everyday bit i actually noticed it caused my breastfed baby sevear lain her doc said that it was because of the milk i drank whole milk my question is if i drink lactaid could it still cause her pain or discomfort? Because as soon as i stoped drinking my daily coffee she was fine