implemented dispose pattern