fix bug for initialize canvas with grid