Making a few changes ,removing null from the canvas.lock();