declare sendMessageCountHandler up to pas undefined and then declare it here