fixed leaky encapsulation