fixed undefined index error due to invalid parsing of csv data