Handles plugin in correct environment