Fixing return value of createCanvasElement