How to know the count of cursor opened?