fixed timer bug when app is in background