bug in gridding fixed