disposing some elements when no longer needed