insertion logic update