batch functions fixed, hopefully