Implement IDisposable interface correctly