Corrected timer bug when activity ends