implemented resizable canvas