sample with dispose implemented