228 close all openned files and pipes fix

fixes #228