sentence: he made a brilliant defense of the mole st nicholas and escaped with the garrison to cuba , but en route there his ship was attacked by an english frigate and after a long engagement he was severely wounded , dying of his wounds in havana on 9 january 1804 .