The invention of the stamp was a part of the attempt to reform and improve the postal system in the United Kingdom of Great Britain and Ireland , which in the early 19th century was in disarray and rife with corruption.