make getCanvasElementById safe, fixes #2

Haven't tested this yet.