fixed bug in pooling