Fix for non updating trial environment count

Code review : Daniel Jao