static friction works under gravity conditions by checking collision counter