fixed undefined index in insert_view_gen