Modified client insertion code