Added environment testing in template