Fix bug with canvas