fixed returning the plugin result from a loop

fixed returning the plugin result from a loop