making the batch upload work correctly