update insertIntoTable with type input check