On and off the nipple

My 3 week old roots and suckles so I offer her a breast, she takes a nipple but won't latch and pulls off then wants the nipple back in. She can sometimes be comforted by walking around when she's like this. She still eats, it's just confusing and frustrating when she gets like this. Any advice?