Update to respect environment

Add to check to see if target == environment or !target