Syrian army gains control over villages after deadly IS attack