fix bug for dividing canvas