count by using master key