added kill buffer and remove file func