changed the excel download logic