Added leak detection