clear function to reset the canvas for each frame