add fix for pipe writing (add '+' to open mode)