I'm unable to understand the interaction mechanism. In the attached picture, why the interaction didn't occur with S and N in the ring. Same in case of amino acid, interaction occurs with carboxylic functional group not with amine? Please help me to understand this