The present invention describes an improved process for preparing highly pure (S)-1-[N- (3-hydroxy-l-adamantyl) glycyl] pyrrolidine-2-carbonitrile known as Vildagliptin. Also the present invention discloses a novel insitu process for preparing an intermediate (2S)- l-(chloroacetyl)pyrrolidine-2-carbonitrile. Further, the present invention discloses a method of preparing undesired dimer impurity.