delete count function