fixed isCanvasEmpty method