who wrote when a man loves a woman