Fixing off-canvas bug