add a draw loop for canvas