saves canvas state