fixed creatGrid method