first version of plugin with close pipes