Added close method for pipes