add function to get enter and exit count