Updated batch process to ensure it works async to prevent race conditions