Fix Env and Add Validation Code