Color code changed. null check code added to onResume.