update canvas in real time