New method for Hofmann rearrangement