setCanvas changed to public