added new method resizeCanvas