insert logic implemented