fixed insertArray to return inserted id