Weird NPC behavior

When i press the button to talk, some NPCs walk away, before answering.