fix process_csv function