change sphereMaterial to global variable