removed undefined references in the onStop() function