Update index.js

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