fix canvas mode bug