canvas grid fix

This fixes the bug happening when you change the canvas grid to other number than 4