grand bugfix in pH thread, part 1