Fixed error with onResume