draw grid function fix