fixed a bug in counting method=null'