Edited insert logic