Deleting the only canvas causes creating a new canvas not to work