Data is not being exported properly when exporting as Excel file