Switched the values of before and after in the getBatch functions