Bug Fix

Bug fix for onPause() and onResume() methods