Add a dispose method to abstract class