added error checks for the return value of send_all in initial_data()