On the chaotic expansion for counting processes