find leaks function