fixed undefined index in insert view gen