Made the dispose method virtual so it can be overriden