The Gabriel method is used for preparation of primary amines without loss of carbons. The reaction of phthalimide with ethanolic KOH gives the result as potassium salt of phthalimide which on heating in presence of RX followed by either alkaline hydrolysis with hydrazine gives the result as primary amine. The reaction is shown below